/* 权限管理模块的API */

import request from '@/request/request'

/* 获取权限点列表的接口 */
export const getPermissionListAPI = () => {
  return request({
    url: '/sys/permission',
    method: 'GET'
  })
}

/* 删除权限点的接口 */
export const deletePermissionAPI = (id) => {
  return request({
    url: `/sys/permission/${id}`,
    method: 'DELETE'
  })
}

/* 新增权限点的接口 */
export const addPermissionAPI = (data) => {
  return request({
    url: '/sys/permission',
    method: 'POST',
    data
  })
}

/* 获取权限点详情的接口 */
export const findPermissionAPI = (id) => {
  return request({
    url: `/sys/permission/${id}`,
    method: 'GET'
  })
}

/* 更新权限点的接口 */
export const updatePermissionAPI = (data) => {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'PUT',
    data
  })
}
